package com.ssy.lingxi.contract.api.feign;

import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.contract.api.model.vo.request.ContrPriceQueryRequest;
import com.ssy.lingxi.contract.api.model.vo.request.ContractPageRequest;
import com.ssy.lingxi.contract.api.model.vo.request.PayApplyAmountVO;
import com.ssy.lingxi.contract.api.model.vo.request.PurchaseMaterielPriceRequestVO;
import com.ssy.lingxi.contract.api.model.vo.response.ContractPageResponse;
import com.ssy.lingxi.contract.api.model.vo.response.ContractPriceQueryVO;
import com.ssy.lingxi.contract.api.model.vo.response.PurchaseMaterielPriceVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.validation.Valid;
import java.util.List;

/**
 * 合同内部接口定义
 * @author 伍将
 * @date 2021/3/19
 * @version 2.0.0
 */
@FeignClient(name = "contract-service")
public interface ContractControllerFeign {

    /**
     * 查询采购物料单价
     * @author 伍将
     * @date 2021/3/19
     **/
    @PostMapping("/contract/feign/getPurchaseMaterielPriceList")
    Wrapper<List<PurchaseMaterielPriceVO>> getPurchaseMaterielPriceList(@RequestBody @Valid PurchaseMaterielPriceRequestVO requestVO);

    /**
     * 支付请款
     * @author 伍将
     * @date 2021/3/24
     **/
    @RequestMapping("/contract/feign/payApplyAmount")
    Wrapper<Void> payApplyAmount(@RequestBody @Valid PayApplyAmountVO payVO);

    /**
     * 查询合同-合同乙方(请款单申请)
     * @author ds
     * @date 2021/3/19
     **/
    @PostMapping("/contract/feign/page/by/partb")
    Wrapper<PageData<ContractPageResponse>> pageContractByPartB(@RequestBody @Valid ContractPageRequest requestVO);

    /**
     * 根据物料信息查询合同(商品能力- 物料价格库)
     * @author lxc
     * @date 2022/3/25
     **/
    @PostMapping("/contract/feign/goodsPrice/by/goods")
    Wrapper<ContractPriceQueryVO> goodsPriceByGoods(@RequestBody @Valid ContrPriceQueryRequest request);
}
